package com.lottery.im.module.result.adapter.result.statistics;

import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lottery.im.R;
import com.lottery.im.api.result.entity.GameHistoryInfo;
import com.lottery.im.module.result.adapter.result.item.HorizontalFastAdapter;
import com.lottery.im.util.SpannerUtils;
import java.util.List;

public class HistoryFastAdapter extends BaseQuickAdapter<GameHistoryInfo, BaseViewHolder> {

  public HistoryFastAdapter(@Nullable List<GameHistoryInfo> data) {
    super(R.layout.item_history_fast_list, data);
  }

  @Override protected void convert(BaseViewHolder helper, final GameHistoryInfo item) {
    helper.setText(R.id.tv_history_date, item.getDate());
    helper.setText(R.id.tv_history_sueId, item.getIsSueId());
    helper.setText(R.id.tv_history_he,
        SpannerUtils.stringUtilColor(mContext.getResources().getColor(R.color.red_fa),
            item.getDaXiao(), "大"));
    helper.setText(R.id.tv_history_type, item.getYuXia());

    RecyclerView mListView = helper.getView(R.id.horizontal_list);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mContext);
    linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
    mListView.setLayoutManager(linearLayoutManager);
    List<String> its = item.getStringStr();
    mListView.setAdapter(new HorizontalFastAdapter(its));
  }
}